package com.neu.cpsp.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.neu.cpsp.pojo.Employee;
import com.neu.cpsp.pojo.EmployeeEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EmployeeMapper extends BaseMapper<Employee> {
    int deleteByPrimaryKey(Integer id);

    int insert(Employee record);

    int insertSelective(Employee record);

    EmployeeEntity selectByPrimaryKey(Integer id);

    EmployeeEntity selectByCard(String idCard);

    EmployeeEntity selectByJobNumber(String jobNumber);

    int updateByPrimaryKeySelective(Employee record);

    int updateByPrimaryKey(Employee record);

    EmployeeEntity getById(Integer id);

    List<String> selectCardByDepart(String department);

    List<EmployeeEntity> findEmployees(String departmentId, String teamGroupId, String name);

    List<EmployeeEntity> selectAll();

    List<EmployeeEntity> selectInfoSelective(String department,String teamGroup, Integer isDirectProducer, String name);

    /**
     * 获取某班组的员工列表
     * @return
     */
    List<EmployeeEntity> selectEmployeesByTeamGroup(String teamGroup, String department);

    /**
     * 获取某部门员工列表
     * @return
     */
    List<EmployeeEntity> selectEmployeesByDepartment(String department);

    List<EmployeeEntity> selectByName(String name);

//    /**
//     * 根据年份和季度获取是否满 45 天的情况
//     * @param year
//     * @param quarter
//     * @return
//     */
//    List<Boolean> selectIs45DaysByYearAndQuarter(@Param("year") Integer year, @Param("quarter") Integer quarter);

    /**
     * 获取某员工是否是 45 天的信息
     * @param idCard
     * @return
     */
    Boolean getIs45Days(String idCard);

    /**
     * 获取某员工是否是直接生产者
     * @param idCard
     * @return
     */
    Boolean getIsDirectProducer(String idCard);
}

